package muster;

import java.util.HashSet;

/**
 * @author:Administrator
 * @date:2022/1/21
 * @describe:
 */
public class HashSetDome {

    public static void main(String[] args) {
        HashSet sets = new HashSet();
        sets.add("www.baidu.com");
        sets.add("www.hao123.com");
        sets.add("www.1688.com");
        sets.add("www.alipay.com");
        sets.add("www.taobao.com");
        sets.add("www.taobao.com");

        System.out.println(sets);
        System.out.println("-------------------------------");
        dome2();
    }

    private static void dome2() {
        HashSet hset = new HashSet();
        hset.add(new Student(1, "小明", 23));
        hset.add(new Student(2, "小丽", 34));
        hset.add(new Student(3, "小王", 27));
        hset.add(new Student(4, "小孙", 29));
        hset.add(new Student(5, "小微", 20));
        hset.add(new Student(6, "大黄", 21));
        hset.add(new Student(7, "小可", 45));
        hset.add(new Student(8, "校长", 67));
        hset.add(new Student(8, "校长", 55));

        for (Object obj : hset) {
            Student stu = (Student) obj;
            System.out.println(stu.getId() + " " + stu.getName());
        }
    }
}
